import datetime
from applications.extensions import db


class Fraction(db.Model):
    __tablename__ = 'admin_fraction'
    id = db.Column(db.Integer, primary_key=True, comment='ID')
    cate = db.Column(db.String(255), comment='分类')
    user_id = db.Column(db.String(255), comment='发布者id')
    username = db.Column(db.String(255), comment='姓名')
    num = db.Column(db.Integer, default=0, comment='分数')
    sort = db.Column(db.Integer, comment='排序')
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='注册时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')
